<template>
    <div>
        <h2 ref="title2">RefDemo 中的H2</h2>
        <button @click="showLog">点我</button>
        <p>{{ a }}</p>
        <p>{{ b }}</p>
        <p>{{ c }}</p>
    </div>
</template>
<script setup lang="ts">
import { ref, defineExpose } from 'vue'
const title2 = ref()
const a = ref(0)
const b = ref(1)
const c = ref(2)
function showLog() {
    console.log(title2.value)
}

// 明确告诉父组件什么信息不需要加密，明文显示
defineExpose({ a, b, c })
</script>

<style></style>